#delim ;
set more off;
capture log close;
capture clear;
*log using , text replace;
set memory 200m;

/***!***!***!***!***!*** [National_banks_crisis1.do ] ***!***!***!***!***!
*
* Project: National Banks  		
* Programmer:  Scott Fulford
*
* Date:    	 8/1/2010
*
* Auditor:      
* Audit Date:   
*
* Purpose:      
* 1) Prep and examine National bank Call data 
* 2) Compare data entered by SLF and John Maney to Weber data
		http://www.minneapolisfed.org/research/economists/wewproj.cfm?#usbanks
* 3)
* 		      
*
* Ouputs: 
*		
*
*
***!***!***!***!***!***!***!***!***!***!***!***!***!***!***!***!***/


/***Define Global Directory ****/
	//Change rootdir to where store files
	global ROOTDIR "F:/Dropbox/national banks peg/Replication_files";
	local INDIR "$ROOTDIR/data";
	local INDIRWEBER "$ROOTDIR/Weber Disaggregate";
	local PROGDIR  "$ROOTDIR";
	local OUTDIR  "$ROOTDIR/data";
	local GRAPHDIR "$ROOTDIR";
/*******************************/

cd "`INDIRWEBER'";

import excel "disaggregate.xls", sheet("data") cellrange(A1:BR11705) firstrow;
gen call_date = date(date, "MDY");
/* For some reason the dates are sometimes formatted differently, and stata
does not recognize them, replace the different formats only if missed on
first pass;
*/
replace call_date = date(date, "DMY") if call_date ==.;
order call_date;

format call_date %td;
inspect call_date;
replace location = upper(location);
/*Notes:
Names:
 Kansas City = City of Kansas City, K
 City of Kansas City Missouri = City of Kansas City, M
 New York City= City of New York
 */
 
/*Rename to match our naming conventions*/

	foreach pair in 
	`"loansdiscounts	loans_assets                                        "'
`"overdrafts	overdrafts_assets                                       "'
`"USbondssecurities	Usbondssecurities_assets                          "'
`"otheritems	otheritems_assets                                       "'
`"bondsforcirculation	bonds_circulation_assets                        "'
`"miscsecuritiestosecurecircul	miscsecurities_circul_assets   "'
`"bondsfordeposits	bonds_deposits_assets                             "'
`"otherbondsfordeposits	other_bonds_deposits_assets                   "'
`"USbondsonhand	us_bonds_assets                                       "'
`"OtherUSbondsandsecurities	OtherUSbonds_securities_assets          "'
`"bondssecuritiesandetc	other_stocks_assets                           "'
`"stocks	stocks_assets                                               "'
`"duefromredeemingreserveage	reserves_assets                         "'
`"duefromnationalbanks	national_banks_assets                         "'
`"duefromstatebanks	state_banks_assets                                "'
`"duefromnationalotherbanks	due_nationalotherbanks_assets          "'
`"duefromotherbanksbankers	due_otherbanksbankers_assets           "'
`"bankinghouseetc	banking_house_assets                                "'
`"realestateetc	real_estate_assets                                    "'
`"currentexpenses	current_expenses_assets                             "'
`"premiumspaid	premiums_assets                                       "'
`"stamps	revenue_stamps_assets                                       "'
`"cashitems	cash_items_assets                                         "'
`"clearinghouseloancertificates	clearing_cert_assets                  "'
`"clearinghouseexchanges	clearing_house_assets                       "'
`"billsofotherbanks	bills_banks_assets                                "'
`"fractionalcurrency	fractional_currency_assets                      "'
`"tradedollars	trade_dollars_assets                                  "'
`"specieandotherlawfulmoney	specie_other_money_assets          "'
`"specie	specie_assets                                               "'
`"legaltendernotes	legal_notes_assets                                "'
`"compoundinterestnotes	compoundinterestnotes_assets                  "'
`"threepercentcertificates	threeper_cert_assets           "'
`"UScertificatesofdeposit	us_cert_deposit_assets                      "'
`"fundwithTreasury	fund_treas_assets                                 "'
`"duefromUSTreasury	us_treas_assets                                   "'
`"capital	capital_stock_liab                                          "'
`"surplusfund	surplus_fund_liab                                       "'
`"undividedprofits	undivided_profits_liab                            "'
`"nationalbankcirculation	national_circulation_liab                   "'
`"statebankcirculation	state_circulation_liab                        "'
`"dividendsunpaid	dividends_unpaid_liab                               "'
`"individualdeposits	individual_deposits_liab                        "'
`"certifiedchecks	certifiedchecks_liab                                "'
`"USdeposits	us_deposits_liab                                        "'
`"postalsavingsdeposits	postalsavingsdeposits_liab                    "'
`"depositsUSdisbursingofficer	deposits_us_officers_liab               "'
`"duetonationalbanks	due_national_banks_liab                         "'
`"duetonationalandotherbanks	due_national_otherbanks_liab         "'
`"duetostatebanks	due_state_banks_liab                                "'
`"duetootherbanksandbankers	due_otherbanks_liab            "'
`"duetosavingsbankstrusts	due_trust_liab                              "'
`"duetoreserveagents	due_reserves_liab                               "'
`"bondsborrowed	bonds_borrowed_liab                                   "'
`"USbondsborrowed	Usbondsborrowed_liab                                "'
`"otherbondsborrowed	otherbondsborrowed_liab                         "'
`"notesrediscounted	notes_rediscounted_liab                           "'
`"billspayable	bills_payable_liab                                    "'
`"clearinghouseloancertificat	clearing_cert_liab                      "'
`"reservedfortaxes	reserved_taxes_liab                               "'
`"otherliabilities	other_liab                                        "'
`"TotalAsset	total_assets                                            "'
`"TotalLiab	total_liab                                                "'
	 {;

		gettoken vara pair: pair;
		gettoken varb pair: pair;
		rename `vara' `varb' ;
 
};

cd "`OUTDIR'";
sort call_date location;
save National_bank_call_reports_Weber, replace;


cd "`INDIR'";

/*Updated and corrected version*/
use 1887_1900_merged_v2, clear;

append using 1901_1907_merged;

/*Drop locations that are blank for that call date (usually added later in year)*/
drop if call_date == "MARCH 22" & location=="CITY OF PUEBLO" & 	reportyear==	1907;


/*Fix some locations*/
replace location = "NEW YORK CITY" if location == "CITY OF NEW YORK";
replace location = "KANSAS CITY" if location == "CITY OF KANSAS CITY";
replace location = "CITY OF SAN FRANCISCO" if location == "SAN FRANCISCO";
replace location = "CITY OF SALT LAKE CITY" if location == "SALT LAKE CITY";

/*Fix several odd dates*/
replace call_date = "JULY 18" if call_date == "18-Jul" & reportyear == 1890;
replace call_date = "FEBRUARY 28" if call_date == "28-Feb" & reportyear == 1890;
replace call_date = "DECEMBER 11" if call_date == "11-Dec" & reportyear == 1890;
replace call_date = "MAY 17" if call_date == "17-May" & reportyear == 1890;
replace call_date = "OCTOBER 2" if call_date == "2-Oct" & reportyear == 1890;

/*Fix some missing items*/
gen clearing_cert_assets =. ; /*Seems to be only in New York City in occasional call dates*/
replace clearing_cert_assets = 6935000 if call_date == "DECEMBER 19" & location== "NEW YORK CITY" & reportyear == 1891;
gen loan_cert_assets =.;
gen loan_cert_liabilities =.;
replace loan_cert_assets = 4235000 if call_date == "DECEMBER 19" & location== "CITY OF PHILADELPHIA" & reportyear == 1891;
replace loan_cert_assets = 610000 if call_date == "FEBRUARY 26" & location== "CITY OF PHILADELPHIA" & reportyear == 1891;
replace loan_cert_assets = 120000 if call_date == "MAY 4" & location== "CITY OF PHILADELPHIA" & reportyear == 1891;
replace loan_cert_liabilities = 3755000 if call_date == "DECEMBER 19" & location== "CITY OF PHILADELPHIA" & reportyear == 1891;
replace loan_cert_liabilities = 1144416 if call_date == "FEBRUARY 26" & location== "CITY OF PHILADELPHIA" & reportyear == 1891;
replace loan_cert_liabilities = 258000 if call_date == "MAY 4" & location== "CITY OF PHILADELPHIA" & reportyear == 1891;


/*Put in order of 1893 call report which does not included several items*/
order   call_date location reportyear banks loans_assets bonds_circulation_assets bonds_deposits_assets us_bonds_assets other_stocks_assets reserves_assets national_banks_assets state_banks_assets banking_house_assets real_estate_assets current_expenses_assets premiums_assets cash_items_assets clearing_house_assets bills_banks_assets fractional_currency_assets specie_assets legal_notes_assets us_cert_deposit_assets fund_treas_assets us_treas_assets overdrafts_assets trade_dollars_assets  revenue_stamps_assets clearing_cert_assets loan_cert_assets capital_stock_liabilities surplus_fund_liabilities  undivided_profits_liabilities national_circulation_liabilities state_circulation_liabilities  dividends_unpaid_liabilities individual_deposits_liabilities us_deposits_liabilities deposits_us_officers_liabilities due_national_banks_liabilities due_state_banks_liabilities notes_rediscounted_liabilities bills_payable_liabilities other_liabilities due_reserves_liabilities due_trust_liabilities loan_cert_liabilities;


/* Fix some data entry problems
Changed Minnesota in 1889 to 56 from 156
Confirm drop in banks in Montana in 1893
Confirm drop in banks in New Orleans Oct 6 1896
Confirm drop in banks in California in 1893
Confirm change in New Mexico in 1892
Confirm drop in banks in Utah July 12 1893

*/
replace banks = 39 if reportyear ==1891 & call_date == "MAY 4" & location == "SOUTH DAKOTA";
replace banks = 11 if reportyear ==1894 & call_date == "JULY 18" & location == "CITY OF CLEVELAND";
replace banks = 190 if reportyear ==1893 & call_date == "MAY 4" & location == "ILLINOIS";
replace banks = 56 if reportyear ==1888 & call_date == "OCTOBER 4" & location == "MINNESOTA";
replace banks = 41 if reportyear ==1893 & call_date == "OCTOBER 3" & location == "CITY OF PHILADELPHIA";
replace banks = 31 if reportyear ==1887 & call_date == "AUGUST 1" & location == "COLORADO";
replace banks = 56 if reportyear ==1890 & call_date == "FEBRUARY 28" & location == "MINNESOTA";
replace banks = 36 if reportyear ==1906 & call_date == "SEPTEMBER 4" & location == "CITY OF PHILADELPHIA";
replace banks = 75 if reportyear ==1906 & call_date == "SEPTEMBER 4" & location == "MARYLAND";
replace banks = 632 if reportyear ==1906 & call_date == "SEPTEMBER 4" & location == "PENNSYLVANIA";
replace banks = 30 if reportyear ==1907 & call_date == "MARCH 22" & location == "CITY OF PITTSBURGH";
replace banks = 7 if reportyear ==1907 & call_date == "MAY 20" & location == "CITY OF CLEVELAND";
replace banks = 7 if reportyear ==1907 & call_date == "AUGUST 22" & location == "CITY OF CLEVELAND";
replace banks = 381 if reportyear ==1907 & call_date == "MARCH 22" & location == "ILLINOIS";
replace banks = 8 if reportyear ==1907 & call_date == "26 JANUARY" & location == "CITY OF ST LOUIS";
replace banks = 36 if reportyear ==1905 & call_date == "AUGUST 25" & location == "WASHINGTON";
replace banks = 83 if reportyear ==1907 & call_date == "MAY 20" & location == "SOUTH DAKOTA";



cap prog drop correctval ;
prog def correctval;
	args  var newval reportyear location call_date;
	replace `var' = `newval' if call_date ==`"`call_date'"' & reportyear == `reportyear' & location ==`"`location'"';	
end;

/*
Many of the isssues are original to the data: either they were printers errors or done by the accountants at the comptroller of the currency. 
That makes it difficult to correct the data---it has already gone through several checks, so remaining problems are 
either original to the data or the result of ambiguitites in the scans. 
NEW HAMPSHIRE	MAY 13	1887 sum ass != total, confirm from reports
CITY OF ALBANY	MARCH 4	1887 sum liab != total, confirm from reports
*/
/*City of Washington sum liab does not add up. Appears to be printer's error in state_banks_liab*/
replace due_state_banks_liabilities = 55003 if call_date =="DECEMBER 28" & reportyear == 1887 & location =="CITY OF WASHINGTON";	
/*Input errors*/
replace due_state_banks_liabilities = 4930363 if call_date =="OCTOBER 2" & reportyear == 1890 & location =="CITY OF ST LOUIS";
replace cash_items_assets = 256655 if reportyear == 1887	& call_date =="MARCH 4" & location==	"MAINE";	


correctval specie_assets 1359564 1890 "OREGON" "OCTOBER 2"; /*PRINTER ERROR*/
correctval legal_notes_assets 15128 1891 "ARIZONA" "JULY 9"; /*PRINTER ERROR*/
correctval loans_assets  47826968 1892 "CONNECTICUT"	"DECEMBER 2"; /*PRINTER ERROR*/
correctval due_national_banks_liabilities 1447618 1893 "CITY OF MINNEAPOLIS"	"MARCH 6"; /*entry ERROR*/
correctval reserves_assets 1061371 1893 "CITY OF NEW ORLEANS"	"JULY 12"; /*entry ERROR*/
correctval capital_stock_liabilities 2133985 1893 "DELAWARE"	"DECEMBER 9"; /*entry ERROR*/
correctval individual_deposits_liabilities 6041587 1893 "GEORGIA"	"MARCH 6"; /*entry ERROR*/
correctval capital_stock_liabilities 17253630 1893 "ILLINOIS"	"MAY 4"; /*entry ERROR*/
correctval surplus_fund_liabilities 128000 1893 "NEVADA"	"JULY 12"; /*entry ERROR*/
correctval total_assets 8615783 1893 "SOUTH CAROLINA"	"OCTOBER 3"; /*entry ERROR*/
correctval capital_stock_liabilities 2550000 1893 "SOUTH DAKOTA"	"JULY 12"; /*entry ERROR*/
correctval bonds_circulation_assets 1456250 1893 "VIRGINIA"	"MAY 4"; /*entry ERROR*/
correctval surplus_fund_liabilities  1297000 1894 "CITY OF ALBANY"	"MAY 4"; /*PRINTER ERROR*/
correctval us_deposits_liabilities 509708 1894 "KENTUCKY"	"OCTOBER 2"; /*entry ERROR*/

correctval us_deposits_liabilities 0 1896 "MISSOURI"	"JULY 14"; /*entry ERROR*/
correctval us_deposits_liabilities 0 1896 "MISSOURI"	"OCTOBER 6"; /*entry ERROR*/
correctval other_stocks_assets 1367067 1896 "CITY OF ST LOUIS"	"OCTOBER 6"; /*PRINTER ERROR*/
correctval us_deposits_liabilities 0 1898 "NORTH DAKOTA"	"SEPTEMBER 20"; /*entry ERROR*/
correctval us_deposits_liabilities 0 1900 "NEBRASKA"	"APRIL 26"; /*entry ERROR*/
correctval us_deposits_liabilities 0 1900 "NEBRASKA"	"JUNE 29"; /*entry ERROR*/
correctval dividends_unpaid_liabilities 1000 1900 "NEBRASKA"	"APRIL 26"; /*entry ERROR*/
correctval dividends_unpaid_liabilities 2603 1900 "NEBRASKA"	"JUNE 29"; /*entry ERROR*/
correctval other_stocks_assets 762413 1890 "VIRGINIA"	"JULY 18"; /*entry ERROR*/
correctval national_circulation_liabilities 1031897 1893 "ALABAMA"	"DECEMBER 9"; /*BAD SCAN*/
correctval national_circulation_liabilities 571000 1893 "CITY OF BROOKLYN"	"OCTOBER 3"; /*PRINTER ERROR*/
correctval due_state_banks_liabilities 353053 1893 "CITY OF SAN FRANCISCO"	"OCTOBER 3"; /*ENTRY ERROR*/
correctval undivided_profits_liabilities 1867075 1893 "INDIANA"	"OCTOBER 3"; /*ENTRY ERROR*/
correctval total_liabilities 43083925 1893 "MICHIGAN"	"OCTOBER 3"; /*ENTRY ERROR*/
correctval banking_house_assets 915007 1894 "CALIFORNIA"	"JULY 18"; /*ENTRY ERROR*/
correctval individual_deposits_liabilities 4675824 1895 "CITY OF LOUISVILLE"	"JULY 11"; /*entry ERROR*/
correctval reserves_assets 198699 1899 "CITY OF LINCOLN"	"DECEMBER 1"; /*BAD SCAN*/
correctval trade_dollars_assets 25 1887 "SOUTH CAROLINA"	"DECEMBER 28"; /*BAD SCAN*/
correctval other_stocks_assets 596311 1887 "SOUTH CAROLINA"	"DECEMBER 28"; /*BAD SCAN*/
correctval us_bonds_assets 15400 1887 "TENNESSEE"	"MAY 13"; /*BAD SCAN*/
correctval current_expenses_assets 486274 1887 "OHIO"	"MARCH 4"; /*BAD SCAN*/
correctval bills_banks_assets 1418591 1887 "OHIO"	"MARCH 4"; /*BAD SCAN*/
correctval total_assets 11527237 1887 "MONTANA"	"MARCH 4"; /*BAD SCAN*/
correctval individual_deposits_liabilities 6697226 1888 "VERMONT"	"OCTOBER 4"; /*BAD SCAN*/
correctval bills_banks_assets 222364 1889 "MISSOURI"	"FEBRUARY 26"; /*ENTRY ERROR*/
correctval bills_payable_liabilities 100000 1889 "CITY OF ST JOSEPH"	"DECEMBER 12"; /*ENTRY ERROR*/
/*Texas DECEMBER 11 1890 does not match, no obvious reason why, likely a printer error, but change is not obvious
only reasonable change is to individual deposits*/
correctval individual_deposits_liabilities 26889070 1890 "TEXAS"	"DECEMBER 11"; /*PRINTER ERROR*/

correctval us_deposits_liabilities 119536 1891 "NORTH CAROLINA"	"FEBRUARY 26"; /*PRINTER ERROR*/
correctval current_expenses_assets 24829 1892 "MARYLAND"	"JULY 12"; /*PRINTER ERROR CHANGE TO MATCH SUM*/
correctval other_liabilities 625000 1893 "CITY OF BALTIMORE"	"OCTOBER 3"; /*ENTRY ERROR*/
correctval reserves_assets 2422353 1893 "CITY OF BALTIMORE"	"MARCH 6"; /*ENTRY ERROR*/
correctval us_deposits_liabilities 714008 1893 "CITY OF CINCINNATI"	"JULY 12"; /*ENTRY ERROR*/
correctval notes_rediscounted_liabilities 63560  1893 "CITY OF OMAHA"	"MAY 4"; /*ENTRY ERROR*/
correctval notes_rediscounted_liabilities 428861  1893 "CITY OF OMAHA"	"JULY 12"; /*ENTRY ERROR*/
correctval bonds_circulation_assets 181250  1893 "IDAHO"	"DECEMBER 9"; /*BAD SCAN*/
correctval national_banks_assets 94906  1893 "MISSISSIPPI"	"MARCH 6"; /*ENTRY ERROR*/
correctval undivided_profits_liabilities 3585766  1893 "NEW JERSEY"	"OCTOBER 3"; /*ENTRY ERROR*/
correctval individual_deposits_liabilities 3332824  1893 "NORTH CAROLINA"	"OCTOBER 3"; /*ENTRY ERROR*/
correctval fund_treas_assets 13012  1893 "WYOMING"	"MAY 4"; /*ENTRY ERROR*/
correctval bonds_circulation_assets 8380000  1894 "CITY OF BOSTON"	"FEBRUARY 28"; /*ENTRY ERROR*/
correctval loans_assets 154872471  1894 "CITY OF BOSTON"	"OCTOBER 2"; /*printer ERROR*/
correctval banking_house_assets 1939425  1894 "ILLINOIS"	"DECEMBER 19"; /*entry ERROR*/
correctval reserves_assets 209889  1894 "MISSISSIPPI"	"MAY 4"; /*entry ERROR*/

correctval specie_assets 640929  1895 "NEW HAMPSHIRE"	"SEPTEMBER 28"; /*entry ERROR*/
correctval  banking_house_assets 3527910   1895 "MASSACHUSETTS"	"DECEMBER 19"; /*entry ERROR*/
correctval national_banks_assets 2279512  1897 "PENNSYLVANIA"	"MARCH 9"; /*printer ERROR*/
correctval  reserves_assets 1068364  1898 "ARKANSAS"	"FEBRUARY 18"; /*ENTRY ERROR*/
correctval  surplus_fund_liabilities 2731256  1899 "MAINE"	"APRIL 5"; /*PRINTER ERROR*/
correctval  national_circulation_liabilities 16486694  1899 "MASSACHUSETTS"	"JUNE 30"; /*BAD SCAN*/
correctval   reserves_assets 2814310   1900 "CITY OF ST PAUL"	"DECEMBER 2"; /*BAD SCAN*/

correctval   individual_deposits_liabilities 10940535   1899 "CITY OF DETROIT"	"DECEMBER 1"; /*entry error*/
correctval   us_deposits_liabilities 615332   1899 "CITY OF DETROIT"	"DECEMBER 1"; /*entry error*/
correctval   deposits_us_officers_liabilities 55259   1899 "CITY OF DETROIT"	"DECEMBER 1"; /*entry error*/
correctval   notes_rediscounted_liabilities 0   1899 "CITY OF DETROIT"	"DECEMBER 1"; /*entry error*/

correctval total_liabilities                   53605637       1904 "MAINE"	"SEPTEMBER 6"; /*entry ERROR*/
correctval dividends_unpaid_liabilities        36559          1904 "MASSACHUSETTS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval total_liabilities                   189479961          1904 "MASSACHUSETTS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval individual_deposits_liabilities     23617887         1906 "MISSOURI"	"SEPTEMBER 4"; /*entry ERROR*/
correctval total_liabilities 					38685652    1906 "MISSOURI"	"SEPTEMBER 4"; /*entry ERROR*/
correctval total_liabilities 					35611613   1907 "INDIAN TERRITORY"	"AUGUST 22"; /*entry ERROR*/
correctval total_assets 					12419047   1907 "CITY OF DES MOINES"	"JANUARY 26"; /*entry ERROR*/
correctval capital_stock_liabilities	7847800   1907 "CALIFORNIA"	"NOVEMBER 12"; /*entry ERROR*/
correctval total_liabilities			76879147   1907 "CALIFORNIA"	"NOVEMBER 12"; /*entry ERROR*/
correctval reserves_assets			1549067   1902 "DELAWARE"	"SEPTEMBER 15"; /*Missprint*/
correctval total_liabilities			323836   1903 "ALASKA"	"SEPTEMBER 9"; /*Missprint*/
correctval reserves_assets			41577   1904 "ALASKA"	"SEPTEMBER 6"; /*Missprint*/
correctval loans_assets			116619   1904 "ALASKA"	"SEPTEMBER 6"; /*Missprint*/
correctval individual_deposits_liabilities		14945026   1904 "CITY OF BROOKLYN"	"SEPTEMBER 6"; /*Missprint*/
correctval due_national_banks_liabilities      169950        1904 "CITY OF SAVANNAH"	"SEPTEMBER 6"; /*entry ERROR*/
correctval us_deposits_liabilities 		2224614        1904 "INDIANA"	"SEPTEMBER 6"; /*entry ERROR*/
correctval undivided_profits_liabilities  1634638         1904 "KANSAS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval loans_assets			18382757   1904 "MARYLAND"	"SEPTEMBER 6"; /*entry ERROR*/
correctval individual_deposits_liabilities		24881181   1906 "GEORGIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval other_stocks_assets  128149510   1907 "NEW YORK CITY"	"JANUARY 26"; /*entry ERROR*/


/*Difficult to read, and checksum failed since all below 10*/
correctval capital_stock_liabilities           2400000        1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval surplus_fund_liabilities            3850000        1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval undivided_profits_liabilities       545773         1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval national_circulation_liabilities    1444695        1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval state_circulation_liabilities       0              1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval due_national_banks_liabilities      2658492        1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval due_state_banks_liabilities         3397761        1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval due_trust_liabilities 				       746703         1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval due_reserves_liabilities            111418         1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval dividends_unpaid_liabilities        8170           1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval individual_deposits_liabilities     19425657       1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval us_deposits_liabilities             429042         1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval deposits_us_officers_liabilities    11823          1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/                                                       
correctval bonds_borrowed_liabilities          0              1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval notes_rediscounted_liabilities      0              1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval bills_payable_liabilities           900000         1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval other_liabilities 		               290242         1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
correctval total_liabilities                   36219784       1904 "CITY OF NEW ORLEANS"	"SEPTEMBER 6"; /*entry ERROR*/
                   

correctval capital_stock_liabilities           22305000       1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval surplus_fund_liabilities            28860000       1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval undivided_profits_liabilities       5159582        1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval national_circulation_liabilities    14922477       1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval state_circulation_liabilities       0              1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_national_banks_liabilities      65501106       1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_state_banks_liabilities         12122079       1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_trust_liabilities 				       36216826       1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_reserves_liabilities            10108530       1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval dividends_unpaid_liabilities        24733          1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval individual_deposits_liabilities     146016313      1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval us_deposits_liabilities             4360897        1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval deposits_us_officers_liabilities    84965          1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/                                                       
correctval bonds_borrowed_liabilities          80000          1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval notes_rediscounted_liabilities      564000         1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval bills_payable_liabilities           0              1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval other_liabilities 		               0              1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval total_liabilities                   346326512      1906 "CITY OF PHILADELPHIA"	"SEPTEMBER 4"; /*entry ERROR*/
                                                       
/*Messed up*/
correctval capital_stock_liabilities          58451000    1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval surplus_fund_liabilities           48572204    1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval undivided_profits_liabilities      11351676    1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval national_circulation_liabilities   43032770    1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval state_circulation_liabilities      1498        1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_national_banks_liabilities     1966433     1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_state_banks_liabilities        531102      1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_trust_liabilities 			  1692637     1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_reserves_liabilities           261837      1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval dividends_unpaid_liabilities       140328      1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval individual_deposits_liabilities    323430373   1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval us_deposits_liabilities            4712088     1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval deposits_us_officers_liabilities   38493       1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/                                                       
correctval bonds_borrowed_liabilities         64500       1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval notes_rediscounted_liabilities     743320      1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval bills_payable_liabilities          972300      1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval reserved_taxes_liabilities         16313       1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval other_liabilities 	              462466      1906 "PENNYSLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval total_liabilities                  496411824   1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
       
/*Hard to read*/
correctval capital_stock_liabilities          58451000    1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval surplus_fund_liabilities           48572204    1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval undivided_profits_liabilities      11351676    1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval national_circulation_liabilities   43032770    1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval state_circulation_liabilities      1498        1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_national_banks_liabilities     1966433     1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_state_banks_liabilities        531102      1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_trust_liabilities 				      1692637     1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_reserves_liabilities           261837      1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval dividends_unpaid_liabilities       140328      1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval individual_deposits_liabilities    323430573   1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval us_deposits_liabilities            4712088     1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval deposits_us_officers_liabilities   38493       1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/                                                       
correctval bonds_borrowed_liabilities         64500       1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval notes_rediscounted_liabilities     743320      1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval bills_payable_liabilities          972300      1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval reserved_taxes_liabilities         16313       1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval other_liabilities 		              462466      1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/
correctval total_liabilities                  496411824   1906 "PENNSYLVANIA"	"SEPTEMBER 4"; /*entry ERROR*/

/*Entry from wrong state*/
correctval total_liabilities  2975219               1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval capital_stock_liabilities  750000        1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval surplus_fund_liabilities  189072         1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval undivided_profits_liabilities  39226     1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval national_circulation_liabilities  236170 1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval dividends_unpaid_liabilities  700        1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval individual_deposits_liabilities  1381546 1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval us_deposits_liabilities  103763          1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval deposits_us_officers_liabilities  74798  1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval due_national_banks_liabilities  28223    1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval due_state_banks_liabilities  60341       1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval notes_rediscounted_liabilities  11000    1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval bills_payable_liabilities  99709         1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/
correctval other_liabilities  672                   1894 "NEW MEXICO"	"DECEMBER 19"; /*entry ERROR*/


/*Entry from wrong state*/
correctval total_liabilities  							17760799               1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval capital_stock_liabilities  			5450000        1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval surplus_fund_liabilities  				674000         1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval undivided_profits_liabilities  	821582     1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval national_circulation_liabilities 311797    1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval dividends_unpaid_liabilities  		380        1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval individual_deposits_liabilities  7212341   1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval us_deposits_liabilities  				48404          1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval deposits_us_officers_liabilities 1521  1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval due_national_banks_liabilities  	1376433    1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval due_state_banks_liabilities  		791888     1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval notes_rediscounted_liabilities  	587448   1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval bills_payable_liabilities  			485000         1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/
correctval other_liabilities  							672                   1894 "CITY OF MINNEAPOLIS"	"DECEMBER 19"; /*entry ERROR*/

/*Entry from wrong state*/
correctval total_liabilities  							11988600               1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval capital_stock_liabilities  			3844000        1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval surplus_fund_liabilities  				807482         1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval undivided_profits_liabilities  	564743     1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval national_circulation_liabilities 1008717    1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval state_circulation_liabilities 		0			    1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval dividends_unpaid_liabilities  		7714        1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval individual_deposits_liabilities  4989460   1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval us_deposits_liabilities  				86386          1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval deposits_us_officers_liabilities 3613      1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval due_national_banks_liabilities  	104244    1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval due_state_banks_liabilities  		93122     1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval notes_rediscounted_liabilities  	220715   1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval bills_payable_liabilities  			198400         1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/
correctval other_liabilities  							0                   1894 "ALABAMA"	"DECEMBER 19"; /*entry ERROR*/

/*Entry from wrong date*/
correctval total_assets	                   3645010      1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval loans_assets	                   2439422      1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval overdrafts_assets               12724        1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval bonds_circulation_assets	       175000       1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval bonds_deposits_assets	         0            1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval us_bonds_assets	               0            1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval premiums_assets	               7650         1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval other_stocks_assets	           50917        1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval banking_house_assets	           79852        1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval real_estate_assets	             54593        1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval national_banks_assets	         82927        1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval state_banks_assets	             60856        1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval reserves_assets	               360398       1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval cash_items_assets	             52832        1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval clearing_house_assets	         31021        1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval bills_banks_assets	             3825         1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval fractional_currency_assets	     2320         1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval specie_assets	                 206856       1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval legal_notes_assets	             15936        1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval us_cert_deposit_assets	         0            1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval fund_treas_assets	             7875         1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
correctval us_treas_assets	               0            1894 "CITY OF LINCOLN"	"FEBRUARY 28"; /*entry ERROR*/  
                                                        
/*Entry from wrong date*/
correctval capital_stock_liabilities          4747210      1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval surplus_fund_liabilities           2981877      1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval undivided_profits_liabilities      807249       1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval national_circulation_liabilities   3633860      1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval state_circulation_liabilities      0            1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_national_banks_liabilities     274158       1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_state_banks_liabilities        139829       1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_trust_liabilities 				      65240        1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval due_reserves_liabilities           31287        1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval dividends_unpaid_liabilities       15337        1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval individual_deposits_liabilities    26601437     1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval us_deposits_liabilities            530097       1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval deposits_us_officers_liabilities   902          1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/                                                       
correctval bonds_borrowed_liabilities         0            1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval notes_rediscounted_liabilities     25695        1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval bills_payable_liabilities          230000       1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval reserved_taxes_liabilities         0            1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval other_liabilities 		              21651        1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
correctval total_liabilities                  40105837     1906 "MARYLAND"	"SEPTEMBER 4"; /*entry ERROR*/
														
/*Entry from wrong date*/
correctval capital_stock_liabilities          15700000    1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval surplus_fund_liabilities           11429726    1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval undivided_profits_liabilities      4565985     1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval national_circulation_liabilities   13706565    1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval state_circulation_liabilities      0           1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval due_national_banks_liabilities     53729187    1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval due_state_banks_liabilities        27770098    1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval due_trust_liabilities 				      4013039     1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval due_reserves_liabilities           0           1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval dividends_unpaid_liabilities       7461        1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval individual_deposits_liabilities    68781428    1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval us_deposits_liabilities            4645674     1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval deposits_us_officers_liabilities   16606       1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/                                                       
correctval bonds_borrowed_liabilities         3535594     1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval notes_rediscounted_liabilities     0           1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval bills_payable_liabilities          0           1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval reserved_taxes_liabilities         158455      1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval other_liabilities 		              1041022     1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/
correctval total_liabilities                  209100548   1907 "CITY OF ST LOUIS"	"JANUARY 26"; /*entry ERROR*/														

/*Entry from wrong date*/
correctval capital_stock_liabilities          1900000    1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval surplus_fund_liabilities           1060000    1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval undivided_profits_liabilities      393142     1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval national_circulation_liabilities   1327500    1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval state_circulation_liabilities      0          1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval due_national_banks_liabilities     8279353    1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval due_state_banks_liabilities        1616349    1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval due_trust_liabilities 				      0          1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval due_reserves_liabilities           0          1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval dividends_unpaid_liabilities       110        1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval individual_deposits_liabilities    11719036   1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval us_deposits_liabilities            263317     1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval deposits_us_officers_liabilities   5896       1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/                                                       
correctval bonds_borrowed_liabilities         0          1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval notes_rediscounted_liabilities     0          1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval bills_payable_liabilities          0          1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval reserved_taxes_liabilities         0          1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval other_liabilities 		              22027      1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/
correctval total_liabilities                  26586731   1907 "CITY OF DALLAS"	"MARCH 22"; /*entry ERROR*/

														
/*Entry from wrong date*/
correctval total_assets	                   8184975       1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval loans_assets	                   4092144       1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval overdrafts_assets               51788         1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval bonds_circulation_assets	       692250        1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval bonds_deposits_assets	         150000        1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval us_bonds_assets	               0             1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval premiums_assets	               60096         1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval other_stocks_assets	           747832        1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval banking_house_assets	           392509        1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval real_estate_assets	             262649        1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval national_banks_assets	         376851        1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval state_banks_assets	             67176         1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval reserves_assets	               600841        1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval cash_items_assets	             44015         1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval clearing_house_assets	         8453          1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval bills_banks_assets	             53482         1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval fractional_currency_assets	     3700          1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval specie_assets	                 362296        1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval legal_notes_assets	             187674        1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval us_cert_deposit_assets	         0             1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval fund_treas_assets	             30650         1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  
correctval us_treas_assets	               561           1894 "SOUTH DAKOTA"	"MAY 4"; /*entry ERROR*/  

/*Entry from wrong city*/
correctval total_assets	                   24598184       1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval loans_assets	                   12720384       1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval overdrafts_assets               713421         1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval bonds_circulation_assets	       801000         1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval bonds_deposits_assets	         350000         1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval us_bonds_assets	               190170         1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval premiums_assets	               86609          1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval other_stocks_assets	           2076827        1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval banking_house_assets	           625607         1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval real_estate_assets	             157877         1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval national_banks_assets	         816516         1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval state_banks_assets	             528311         1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval reserves_assets	               2383333        1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval cash_items_assets	             55593          1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval clearing_house_assets	         804683         1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval bills_banks_assets	             149029         1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval fractional_currency_assets	     12510          1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval specie_assets	                 1407795        1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval legal_notes_assets	             682167         1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval us_cert_deposit_assets	         0              1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval fund_treas_assets	             26045          1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  
correctval us_treas_assets	               0              1899 "CITY OF NEW ORLEANS"	"SEPTEMBER 7"; /*entry ERROR*/  



/*Check sum of assets, liabilities*/
gen double sum_assets =0;
foreach v of varlist *_assets {;
	if "`v'" != "total_assets" & "`v'" != "sum_assets" {;
	disp "`v'";
	format %15.0gc `v';
	replace sum_assets = sum_assets + `v' if `v' <.;
	};
};
/*replace sum_assets = sum_assets/2 -total_assets;*/ /*sum assets is added to itself at the end and then total_assets included in sum*/
gen double sum_liabilities=0;
foreach v of varlist *_liabilities {;
	if "`v'" != "total_liabilities" & "`v'" != "sum_liabilities" {;

	disp "`v'";
	format %15.0gc `v';
	replace sum_liabilities = sum_liabilities + `v' if `v' <.;
	};
};
/*replace sum_liabilities = sum_liabilities/2 -total_assets; */

/*Check sum of assets, liabilities*/
*gen double sum_assets2=  loans_assets+ bonds_circulation_assets+ bonds_deposits_assets+ us_bonds_assets+ other_stocks_assets+ reserves_assets+ national_banks_assets+ state_banks_assets+ banking_house_assets+ real_estate_assets+ current_expenses_assets+ premiums_assets+ cash_items_assets+ clearing_house_assets+ bills_banks_assets+ fractional_currency_assets+ specie_assets+ legal_notes_assets+ us_cert_deposit_assets+ fund_treas_assets+ us_treas_assets+ overdrafts_assets+ trade_dollars_assets+ revenue_stamps_assets;
*gen double sum_liabilities2=  bills_payable_liabilities+ capital_stock_liabilities+ deposits_us_officers_liabilities+ dividends_unpaid_liabilities+ due_national_banks_liabilities+ due_state_banks_liabilities+ individual_deposits_liabilities+ national_circulation_liabilities+ notes_rediscounted_liabilities+ other_liabilities+ state_circulation_liabilities+ surplus_fund_liabilities+ us_deposits_liabilities+ undivided_profits_liabilities+  due_reserves_liabilities+ due_trust_liabilities;

/*Remove observations that are zero because they only start tracking during middle of report year
1887	241	KANSAS CITY
1887	246	CITY OF ST JOSEPH
1887	261	CITY OF OMAHA
1887	291	ARIZONA
1890	51	CITY OF BROOKLYN
1890	236	CITY OF ST PAUL
1890	242	CITY OF MINNEAPOLIS
1891	231	CITY OF DES MOINES
1893	66	CITY OF LINCOLN
1896	336	CITY OF HOUSTON
1898	6	ALASKA
1899	91	CITY OF INDIANAPOLIS
1899	306	CITY OF PORTLAND
1900	26	CITY OF LOS ANGELES
1900	41	CITY OF DENVER
1900	306	CITY OF COLUMBUS
*/

drop if  sum_assets==0 &  total_assets==0;
/*For some reason Minneapolis has a value of 1 which should be zero*/
drop if call_date =="DECEMBER 11" & reportyear == 1890 & location =="CITY OF MINNEAPOLIS";	

/**** Check whether remaining errors are caught by totals */
local errorprop = .01; 
gen bassets_liab = (abs(total_liabilities-total_assets)/total_liabilities>`errorprop');
gen bassets =  (abs(sum_assets-total_assets)/total_assets>`errorprop');
gen bliab =  (abs(total_liabilities-sum_liabilities)/total_liabilities>`errorprop');

/*Alaska in 1903, the assets and liabilities are different*/
replace bassets_liab = 0 if location == "ALASKA" & reportyear ==1903 & call_date == "SEPTEMBER 9";



/*
order  bassets_liab bassets bliab sum_assets total_assets sum_liabilities total_liabilities;
format %15.0gc total_liabilities;
format %15.0gc sum_liabilities;
format %15.0gc total_assets;
format %15.0gc sum_assets;
*/
assert ! (bassets_liab|bassets|bliab); 

drop bassets_liab bassets bliab sum_assets sum_liabilities;


/*Create Stata date */
*gen d1 = call_date + "-"+string(reportyear) if reportyear <= 1889 | reportyear == 1893;
gen d1 = call_date + ", "+  string(reportyear); 

gen cd1 = date(d1, "MDY") ;
format cd1 %td;
gen month1 = month(cd1);
gen call_year = reportyear;
replace call_year = reportyear-1 if month1 >=11;
gen day1 = day(cd1);
rename call_date orig_call_date;
gen call_date = mdy(month1, day1, call_year);
format call_date %td;
label var call_date "Call date";
label var call_year "Call year";
label var reportyear "Report year";

/*Drop variables created in making data set*/
drop cd1 month1 day1 d1 t year location1 recordno date orig_call_date;


/*Put to missing items that were not introduced until later
Missing indicates that they could have had a value but were part of another 
variable, while zero implies that the value is known and 0*/
assert  due_reserves_liabilities == . |  due_reserves_liabilities == 0 if call_date < date("02dec1899", "DMY");
replace due_reserves_liabilities = . if call_date < date("02dec1899", "DMY");

assert   due_trust_liabilities== . |  due_trust_liabilities == 0 if call_date < date("26apr1900", "DMY");
replace   due_trust_liabilities= . if call_date < date("26apr1900", "DMY");

assert   banking_house_assets == . |   banking_house_assets == 0 if call_date < date("11dec1889", "DMY");
replace  banking_house_assets = . if call_date < date("11dec1889", "DMY");

assert    trade_dollars_assets == . |    trade_dollars_assets == 0 if call_date > date("12dec1888", "DMY");
replace    trade_dollars_assets = . if call_date > date("12dec1888", "DMY") ;
                                      
assert   current_expenses_assets == . |    current_expenses_assets == 0 if call_date >= date("19dec1893", "DMY");
replace current_expenses_assets =.  if call_date >= date("19dec1893", "DMY");

assert   overdrafts_assets == . |    overdrafts_assets == 0 if call_date < date("19dec1893", "DMY");
replace   overdrafts_assets = . if call_date < date("19dec1893", "DMY");

assert    revenue_stamps_assets== . | revenue_stamps_assets == 0 if call_date < date("26apr1900", "DMY");
replace    revenue_stamps_assets= .  if call_date < date("26apr1900", "DMY");
        

/*Label the variables */
label var capital_stock_liabilities             "Capital stock            ";
label var surplus_fund_liabilities              "Surplus fund             ";
label var undivided_profits_liabilities         "Undivided profits        ";
label var national_circulation_liabilities      "Nat'l-bank circulation   ";
label var state_circulation_liabilities         "State-bank circulation   ";
label var dividends_unpaid_liabilities          "Dividends unpaid         ";
label var individual_deposits_liabilities       "Individual deposits      ";
label var us_deposits_liabilities               "U. S. deposits           ";
label var deposits_us_officers_liabilities      "Dep'ts U.S. dis. officers";
label var due_national_banks_liabilities        "Due to national banks    ";
label var due_state_banks_liabilities           "Due to State banks       ";
label var notes_rediscounted_liabilities        "Notes rediscounted       ";
label var bills_payable_liabilities             "Bills payable            ";
label var other_liabilities                     "Other liabilities        ";
label var total_liabilities                     "Total liabilities        ";
label var due_reserves_liabilities              "Due to reserve agents    ";
label var due_trust_liabilities                 "Due to trust co's, etc.  ";
label var loan_cert_liabilities                 "Loan certificates        ";
                                                                                                                                           
label var  loans_assets               "Loans and discounts    ";
label var  bonds_circulation_assets   "Bonds for circulation  ";
label var  bonds_deposits_assets      "Bonds for deposits     ";
label var  us_bonds_assets            "U. S. bonds on hand    ";
label var  other_stocks_assets        "Other stocks and bonds ";
label var  reserves_assets            "Due from res've agt's  ";
label var  national_banks_assets      "Due from nat'l banks   ";
label var  state_banks_assets         "Due from State banks   ";
label var  banking_house_assets       "Banking house, etc.    ";
label var  real_estate_assets         "Real estate, etc.      ";
label var  current_expenses_assets    "Current expenses       ";
label var  premiums_assets            "Premiums paid          ";
label var  cash_items_assets          "Cash items             ";
label var  clearing_house_assets      "Clear'g-house exch'gs  ";
label var  bills_banks_assets         "Bills of other banks   ";
label var  fractional_currency_assets "Fractional currency    "; 
label var  specie_assets              "Specie                 ";
label var  legal_notes_assets         "Legal-tender notes     ";
label var  us_cert_deposit_assets     "U. S. cert's of deposit";
label var  fund_treas_assets          "5 % fund with Treas    ";
label var  us_treas_assets            "Due from U. S. Treas   ";
label var  overdrafts_assets          "Overdrafts             ";
label var  trade_dollars_assets       "Trade dollars          ";
label var  revenue_stamps_assets      "Int'l-revenue stamps   ";
label var  clearing_cert_assets       "Clearing-house cert's  ";
label var  loan_cert_assets           "Loan certificates      ";                                                            
label var  total_assets               "Total assets           ";                                                            

                                                                          
foreach var of var *_liabilities {;
	local newvar = subinstr("`var'", "liabilities", "liab" ,1) ;
	rename `var' `newvar';
};
order  call_year call_date location reportyear banks total_assets total_liab;

/*Rename to match Weber data*/
replace location = "CITY OF NEW YORK" if location == "NEW YORK CITY";
replace location = "CITY OF KANSAS CITYM" if location == "KANSAS CITY";
replace location = "CITY OF KANSAS CITYK" if location == "CITY OF KANSAS CITY KANSAS";
replace location = "PUERTO RICO" if location == "PORTO RICO";


replace call_date = date("13may1889", "DMY") if call_date == date("14may1889", "DMY");

sort call_date location;
tempfile NBOLD NB_banks;
save `NBOLD', replace;
keep call_date location banks;
save `NB_banks', replace;
use `NBOLD', clear;


/*Compare to Weber*/
foreach var in * {;
	rename `var' O`var';
};
rename Ocall_date call_date;
rename Olocation location;


merge 1:1 call_date location using "`OUTDIR'\National_bank_call_reports_Weber";

tab _merge;
gen diff = Ototal_assets-total_assets;
gen diff_liab = Ototal_liab-total_liab;
gen Odiff =Ototal_assets -Ototal_liab;
gen Ndiff= total_assets-total_liab;
order Odiff Ndiff diff diff_liab Ototal_assets total_assets Ototal_liab total_liab;
/*There are difference between them, 
Most differences seem to be small (rounding errors) less than 100
Larger errors came from an odd rounding to the 10,000 place that occured
in several of the overall totals in our data.
Other differences are from the call reports themselves: Weber forms
totals by adding up, I formed them from the total reported in the report. The two 
do not always match.
As far as I can tell, where differences exist they are small, our problems 
(still generally small) or a result of different ways of calculating.
Weber data seems fine to use, may be better than our own.

edit if (diff>100 & diff <.) | (diff_liab>100 & diff_liab <.);
*/


/*Save Weber data to use in rest of analysis*/

use  "`OUTDIR'\National_bank_call_reports_Weber", clear;
sort call_date location;
/*Merge in banks from our own data, not all years/and call dates in ours*/
merge 1:1 call_date location using "`NB_banks'";

/*get ordering of call reports right*/
gen week_call_date = week(call_date);
gen call_year = year(call_date);
histogram week_call_date, bin(52) xlabel(1(2)52);

gen callnum = 1 if week_call_date <12;
replace callnum =2 if week_call_date >=12 &  week_call_date  <23; 
replace callnum =3 if week_call_date >=23 &  week_call_date  <33;
replace callnum =4 if week_call_date >=33 &  week_call_date  <43;
replace callnum =5 if week_call_date >=43 ;
replace callnum =3 if week_call_date ==20 & call_year ==1907; /*1907 the call dates are fairly early*/
replace callnum =3 if week_call_date ==35 & call_year ==1886; /*Late call date*/
replace callnum =2 if week_call_date ==11 & call_year ==1905; /*Early call date*/
replace callnum =3 if week_call_date ==22 & call_year ==1905; /*Early call date*/

gen call_date_order = (call_year-1900)*5+callnum-1; 
label var call_date_order "Ordered call dates for time series (1900c1 =0)";
sort location;
encode location, gen(loc_no);
xtset loc_no call_date_order; /*For regressions xtset by call date number*/
drop Diff BR _merge date dummy actual;
cd "`OUTDIR'";
saveold National_bank_call_reports, replace;


/*Create aggregate series combining all states/cities as well as
aggregate data from 1900-1910 created by National_banks_combine_aggregates.do*/

/**********
Overall US banking time series
************/
use National_bank_call_reports, replace;
/*uncomment to exclude or restrict just to the major reserve cities
drop if location == "CITY OF BOSTON" | location == "NEW YORK CITY" |  location == "CITY OF CHICAGO" | location == "CITY OF PHILADELPHIA";
*/	
collapse (sum) loans_assets-banks, by(call_year call_date);
/*Keep the aggregates. They are slightly different than the sums
by states and cities. It is possible that some banks were in territories
not included in the states/cities breakdown*/
drop if call_date >= date("13feb1900","DMY");
append using NB_aggregate_1900_1910;

duplicates report call_date;

sort call_date;
save National_bank_call_reports_aggregate, replace;

exit;
